//
//  SleepTYCyclePagerViewCell.m
//  TYCyclePagerViewDemo
//
//  Created by tany on 2017/6/14.
//  Copyright © 2017年 tany. All rights reserved.
//

#import "SleepTYCyclePagerViewCell.h"

@interface SleepTYCyclePagerViewCell ()
@property (nonatomic, weak) UILabel *label;
@end

@implementation SleepTYCyclePagerViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame])
    {
        self.backgroundColor = [UIColor clearColor];
        [self addLabel];
    }
    return self;
}

- (void)addLabel
{
    JLRingChart *sleepCircle = [[JLRingChart alloc]initWithFrame:self.bounds];
    [self addSubview:sleepCircle];
    
    UIButton *bt = [[UIButton alloc] init];
    [self addSubview:bt];

    _button =  bt;
    _sleepCircle = sleepCircle;
}

- (void)updateCellWith:(NSInteger )index
{
    _sleepCircle.frame = self.bounds;
    _button.frame = self.bounds;
    _sleepCircle.center = _button.center;
    _sleepCircle.ringWidth = 12;
    _sleepCircle.valueDataArr = @[@"0"];
    [_sleepCircle startToDrawLayer];//必须有
}

//- (void)layoutSubviews {
//    [super layoutSubviews];
//    
//    _sleepCircle.frame = self.bounds;
//    _button.frame = self.bounds;
//    _sleepCircle.center = _button.center;
//    _sleepCircle.ringWidth = 12;
//    _sleepCircle.valueDataArr = @[@"0"];
//    [_sleepCircle startToDrawLayer];//必须有
//}

@end
